package com.qijian.flowable.service.impl;

import java.util.List;

import com.google.common.base.Strings;
import com.qijian.common.utils.DateUtils;
import com.qijian.common.utils.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.qijian.flowable.mapper.MatrixFieldMapper;
import com.qijian.flowable.domain.MatrixField;
import com.qijian.flowable.service.IMatrixFieldService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 流程矩阵字段Service业务层处理
 *
 * @author qijian
 * @date 2022-02-08
 */
@Service
@RequiredArgsConstructor
public class MatrixFieldServiceImpl extends ServiceImpl<MatrixFieldMapper, MatrixField> implements IMatrixFieldService {

    private final MatrixFieldMapper matrixFieldMapper;

    @Override
    @Transactional
    public void saveOrUpdateMatrixField(List<MatrixField> matrixFields) {

        matrixFieldMapper.deleteByMatrixIdId(matrixFields.get(0).getMatrixId());

        matrixFields.forEach(x -> {
            matrixFieldMapper.insert(x);
        });
    }

}
